<div class="row-fluid">
	<a style="border:1px solid #ccc" class="block-heading" data-toggle="collapse">列表数据</a>
    <div class="well">
	    <div class="btn-toolbar">
	    	<button class="btn btn-primary ifrm" data-url="/slide/addslide" data-width="500" data-height="350" data-title="添加幻灯类别" data-params="" style="position:relative;float:right;padding:3px 6px;margin-right:10px">添加幻灯类别</button>
		    <form>
		    	<label style="display: inline;">幻灯名称：</label><input class="input input-medium" type="text" value="<?=I('get.slidename')?>" name="slidename" />
		    	<label style="display: inline;margin-left: 15px">幻灯ID：</label><input class="input input-medium" type="text" value="<?=I('get.slideid')?>" name="slideid" />
		    	<input type="hidden" value="<?=I('get.res')?>" name="res" />
		    	<button class="btn btn-info" style="margin:-9px 0 0 15px"><i class="icon-search"></i> 搜索</button>
		    </form>
		</div>
		<hr>
		<table class="table">
		      <thead>
		        <tr>
		          <th style="text-align:center">幻灯名称</th>
		          <th style="text-align:center">详细</th>
		          <th style="text-align:center">排序字段</th>
		          <th style="text-align:center">添加时间</th>
		          <th style="text-align:center">操作</th>
		        </tr>
		      </thead>
		      <tbody>
		      	<?php if($slideData){foreach($slideData AS $key=>$val){ ?>
		        <tr> 
		          <td style="text-align:center;vertical-align:middle"><?=$val['title']?></td>
		          <td style="text-align:center;">
		          <?php $getDataCon = M('SlideContent')->where(array('slide_id'=>$val['slide_id']))->select();if($getDataCon){?>
		          <center><table style="border:1px solid pink">
				  <?php foreach($getDataCon AS $vals){?>
		          		<tr style="border:1px solid pink">
		          			<td>
		          				<img src="<?=transUrl($vals['pic_url'])?>" width=100 height=90>
		          				<div style="float:right">
			          				<p style="margin-left:10px"><a href="<?=$vals['click_url']?>" target="_blank"><?=$vals['title']?></a></p>
			          				<p style="margin-left:10px">添加时间：<?=date("Y-m-d H:i",$vals['add_at'])?></p>
		          				</div>
		          			</td>
		          			<td style="text-align:center;">
					          	<a class="ifrm" href="javascript:void(0)" data-url="/slide/addslidev" data-width="750" data-height="550" data-title="修改幻灯" data-params="conid/<?=$vals['slide_content_id']?>"><i class="icon-pencil"></i></a>&nbsp;&nbsp;&nbsp;
					            <a href="/index.php/slide/deleslide?did=<?=$vals['slide_content_id']?>&dtype=c" class="deattv"  role="button" data-toggle="modal"><i class="icon-remove"></i></a>
					        </td>
		          		</tr>
		          <?php }?>
		          </table></center>
		          <?php }else{?>
		          <span>暂未配置</span>
		          <?php }?></td>
		          <td style="text-align:center;vertical-align:middle"><?=$val['sort']?></td>
		          <td style="text-align:center;vertical-align:middle"><?=date('Y-m-d',$val['add_at'])?></td>
		          <td style="text-align:center;vertical-align:middle">
		          		<a class="ifrm btn btn-success" href="javascript:void(0)" style="padding: 0px 4px;" data-url="/slide/addslidev" data-width="750" data-height="550" data-title="添加幻灯" data-params="slide/<?=$val['slide_id']?>"><i class="icon-plus"></i></a>&nbsp;&nbsp;
		          		<a class="ifrm btn btn-info" href="javascript:void(0)" style="padding: 0px 4px;" data-url="/slide/addslide" data-width="500" data-height="350" data-title="修改幻灯类别" data-params="slide/<?=$val['slide_id']?>"><i class="icon-pencil"></i></a>&nbsp;&nbsp;&nbsp;
		              	<a href="/slide/deleslide?did=<?=$val['slide_id']?>&dtype=e" style="padding: 0px 4px;" class="deattv btn btn-danger"  role="button" data-toggle="modal"><i class="icon-remove"></i></a>
		          </td>
		        </tr>
		        <?php }}else{?>
		        <tr><td style="text-align:center;vertical-align:middle" colspan=5>暂无数据</td></tr>
		        <?php }?>
		      </tbody>
		   </table>
		   <span style="float:right;margin-top:-25px"><?=$page?></span>
	</div>
</div>
<script>
$(function(){
	$('.deattv').click(function(){
		if(!window.confirm('确认要删除该幻灯么 ?')){
			return false;
		}
		window.location = $(this).attr('href');
	});
})
</script>